package com.example.medicalequipment.entity;

import androidx.room.Entity;
import androidx.room.PrimaryKey;

@Entity(tableName = "users")
public class User {

    public static final int TYPE_NORMAL = 0;
    public static final int TYPE_REPAIR = 1;

    @PrimaryKey(autoGenerate = true)
    private int id;
    private String username;
    private String password;
    private String contact;
    private int userType;

    public User(String username, String password, String contact, int userType) {
        this.username = username;
        this.password = password;
        this.contact = contact;
        this.userType = userType;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public int getUserType() {
        return userType;
    }

    public void setUserType(int userType) {
        this.userType = userType;
    }

    public boolean isRepairUser() {
        return userType == TYPE_REPAIR;
    }
}
